package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:04:40
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemResourceProperty implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.system.dao.ISysResourcePropertyDAO.Id);

        mappedDaoFields.put("propertyCode",
            com.ourteam.system.dao.ISysResourcePropertyDAO.ResourcePropertyCode);

        mappedDaoFields.put("propertyName",
            com.ourteam.system.dao.ISysResourcePropertyDAO.ResourcePropertyName);

        mappedDaoFields.put("propertyType",
            com.ourteam.system.dao.ISysResourcePropertyDAO.ResourcePropertyType);

        mappedDaoFields.put("propertySort",
            com.ourteam.system.dao.ISysResourcePropertyDAO.ResourcePropertyOrder);

        mappedDaoFields.put("propertyValue",
            com.ourteam.system.dao.ISysResourcePropertyDAO.ResourcePropertyValue);

        mappedDaoFields.put("systemResourceId",
            com.ourteam.system.dao.ISysResourcePropertyDAO.SysResourceId);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysResourcePropertyDAO.Remarks);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysResourcePropertyDAO.Status);
    }

    private com.ourteam.system.dao.SysResourceProperty sysResourceProperty;

    public SystemResourceProperty() {
        super();

        this.sysResourceProperty = new com.ourteam.system.dao.SysResourceProperty();
    }

    public SystemResourceProperty(
        com.ourteam.system.dao.SysResourceProperty sysResourceProperty) {
        super();

        this.sysResourceProperty = sysResourceProperty;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysResourceProperty);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysResourceProperty convertToSysResourceProperty() {
        return this.sysResourceProperty;
    }

    public com.ourteam.system.dao.SysResourceProperty convertTo() {
        return this.sysResourceProperty;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysResourceProperty.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysResourceProperty.setId(id);
    }

    /**
     * Get propertyCode
     *
     * @return String
     */
    public String getPropertyCode() {
        return (String) this.sysResourceProperty.getResourcePropertyCode();
    }

    /**
     * Set propertyCode
     *
     * @parameter String
     */
    public void setPropertyCode(String propertyCode) {
        this.sysResourceProperty.setResourcePropertyCode(propertyCode);
    }

    /**
     * Get propertyName
     *
     * @return String
     */
    public String getPropertyName() {
        return (String) this.sysResourceProperty.getResourcePropertyName();
    }

    /**
     * Set propertyName
     *
     * @parameter String
     */
    public void setPropertyName(String propertyName) {
        this.sysResourceProperty.setResourcePropertyName(propertyName);
    }

    /**
     * Get propertyType
     *
     * @return String
     */
    public String getPropertyType() {
        return (String) this.sysResourceProperty.getResourcePropertyType();
    }

    /**
     * Set propertyType
     *
     * @parameter String
     */
    public void setPropertyType(String propertyType) {
        this.sysResourceProperty.setResourcePropertyType(propertyType);
    }

    /**
     * Get propertySort
     *
     * @return Integer
     */
    public Integer getPropertySort() {
        return (Integer) this.sysResourceProperty.getResourcePropertyOrder();
    }

    /**
     * Set propertySort
     *
     * @parameter Integer
     */
    public void setPropertySort(Integer propertySort) {
        this.sysResourceProperty.setResourcePropertyOrder(propertySort);
    }

    /**
     * Get propertyValue
     *
     * @return String
     */
    public String getPropertyValue() {
        return (String) this.sysResourceProperty.getResourcePropertyValue();
    }

    /**
     * Set propertyValue
     *
     * @parameter String
     */
    public void setPropertyValue(String propertyValue) {
        this.sysResourceProperty.setResourcePropertyValue(propertyValue);
    }

    /**
     * Get systemResourceId
     *
     * @return long
     */
    public long getSystemResourceId() {
        return (long) this.sysResourceProperty.getSysResourceId();
    }

    /**
     * Set systemResourceId
     *
     * @parameter long
     */
    public void setSystemResourceId(long systemResourceId) {
        this.sysResourceProperty.setSysResourceId(systemResourceId);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysResourceProperty.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysResourceProperty.setRemarks(remarks);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysResourceProperty.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysResourceProperty.setStatus(status);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemResourceProperty) == false) {
            return false;
        } // end if

        SystemResourceProperty other = (SystemResourceProperty) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysResourceProperty tempSysResourceProperty = other.convertToSysResourceProperty();

        if ((tempSysResourceProperty == null) ||
                (this.sysResourceProperty == null)) {
            isEqual = false;
        } else if ((tempSysResourceProperty == this.sysResourceProperty) ||
                tempSysResourceProperty.equals(this.sysResourceProperty)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemResourceProperty[] toArray(
        com.ourteam.system.dao.SysResourceProperty[] aSysResourcePropertys) {
        return toArray(aSysResourcePropertys, null);
    }

    public static SystemResourceProperty[] toArray(
        com.ourteam.system.dao.SysResourceProperty[] aSysResourcePropertys,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysResourcePropertys)) {
            return new SystemResourceProperty[0];
        }

        int length = aSysResourcePropertys.length;

        SystemResourceProperty[] beans = new SystemResourceProperty[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemResourceProperty(aSysResourcePropertys[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aSysResourcePropertys[i] });
            }
        }

        return beans;
    }
}
